package com.mad.game.view;

import java.util.Observable;
import java.util.Observer;

import com.mad.game.backend.GameDemo;
import com.mad.game.system.EGameState;

@SuppressWarnings("unused")
public class ViewManager implements Observer {
	
	public static final int MAIN_WND_WIDTH = 800,	
							MAIN_WND_HEIGHT = 600 ; 
	
	private MainMenuWnd mainMenu = null ; 
	private MainWnd mainWnd = null ; 
	
	public ViewManager() {
	}

	public void updateGraphics() {
		if(GameDemo.getGameInstance().isInGame())
			this.mainWnd.repaint();
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		if(!(arg0 == null || arg1 == null)){
			if(arg1 instanceof EGameState){
				EGameState state = (EGameState)arg1 ; 
				if(state.equals(EGameState.MAIN_MENU) ||  state.equals(EGameState.DEFAULT))
					this.mainMenu = new MainMenuWnd();
				else if(state.equals(EGameState.GAME))
					this.mainWnd = new MainWnd(); 
			}
		}
	}
	
}
